﻿#pragma once

#include "Sprite.h"
#include "SpriteCore.h"
#include "BiDirection.h"

class SpriteState
{
protected:
	SpriteCore &core;

protected:
	void Transition(SpriteState *state)
	{ 
		core.state = state;
		delete this;
	}

public:
	SpriteState(SpriteCore &core) :core(core){}

	virtual ~SpriteState();
	virtual void OnCtrlDirPress(BiDirection d) {}
	virtual void OnCtrlDirRelease(BiDirection d) {}
	virtual void OnCtrlJumpPress(){}//nhảy lên
	virtual void OnCtrlJumpRelease(){}
	virtual void OnUpdate(){}
	virtual void OnCollision(const CollisionRectF &rect){}
	virtual void OnUnsupported(){}

	//just for now....
	float GetY()const
	{
		return core.y;
	}
};

